package com.itheima.edu.practice.test;

import java.util.*;

public class UnVariable {
    public static void main(String[] args) {
        //创建不可变列表
        List<String> list = List.of("a","b");
        System.out.println(list);
        //初始化数组
        ArrayList<String> array = new ArrayList<>(List.of("a","b","c"));
        System.out.println(array);
        array.add("d");
        array.clear();
        System.out.println(array);
        //创建不可变Set集合
        Set<String> set = Set.of("a", "b","c");
        System.out.println(set);

        //创建不可变Map集合
        Map<String,String> maps = Map.of("001","你","002","我");
        System.out.println(maps);

        Map<String,String> map1 = Map.ofEntries(Map.entry("001","002"),Map.entry("002","002"));
        System.out.println(map1);
    }
}
